Skip to content

fix: show the real transaction id, not the local id, when a transaction fetch fails - #3786

Open
jbair06 wants to merge 3 commits into
mainfrom
3785-fix-transaction-fetch-toast-shows-db-id
Open

jbair06 wants to merge 3 commits into
mainfrom
3785-fix-transaction-fetch-toast-shows-db-id

Conversation

@jbair06

@jbair06 jbair06 commented Nov 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Carries the real Hedera-format transaction id (0.0.x@seconds.nanos) from wherever it's already known — a list row, a prior successful load of the same transaction, or transaction creation — into the fetch-failure toast and log, instead of showing the meaningless local DB id. Falls back to the local id only when no real id is known yet (e.g. a direct deep link).
  • Logs the failure with structured context (local id, real id when known, underlying error) in addition to the toast.
  • On an initial-load failure, navigates the user back to whatever transactions tab they came from (or the default tab if they arrived from elsewhere, like the creation flow) instead of leaving them on an infinite loader.

Test plan

  • vue-tsc typecheck passes
  • New/updated unit tests cover: query-param threading in the navigation store, list/creation call sites passing the real id, the toast/log fallback behavior, and the post-failure redirect
  • Full front-end renderer test suite passes (pre-existing, unrelated failures confirmed present on a clean main checkout)

Fixes #3785

…on fetch fails

Carries the real Hedera-format transaction id from wherever it's already known (list row, a prior successful load, or transaction creation) into the fetch-failure toast and log, falling back to the local id only when no real id is available. Also navigates back to the previous transactions tab (or the default tab) on an initial-load failure instead of leaving the page stuck on an infinite loader.

Signed-off-by: John Bair <john.bair@swirldslabs.com>
@jbair06
jbair06 requested a review from a team as a code owner November 19, 2026 08:54
@jbair06 jbair06 self-assigned this Nov 19, 2026
@jbair06
jbair06 requested review from svienot and a lite review from Copilot November 19, 2026 08:54
@jbair06 jbair06 added Bug A error that causes the feature to behave differently than what was expected based on design docs Frontend Frontend development work labels Nov 19, 2026
@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.98%. Comparing base (1502e6e) to head (80076ad).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3786   +/-   ##
=======================================
  Coverage   99.98%   99.98%           
=======================================
  Files         224      224           
  Lines        7032     7034    +2     
  Branches     1302     1297    -5     
=======================================
+ Hits         7031     7033    +2     
  Misses          1        1           

see 1 file with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Three active moderate issues remain: retry flows can report a stale transaction ID, notification-triggered fetch failures lack user-facing errors, and initial-load redirects can use a stale transactions tab.

3 open issues
What changed in this PR

This pull request carries the real Hedera transaction ID through navigation so transaction-fetch failures show meaningful identifiers, include structured logging, and return users to the transactions view after an initial-load failure.

Changes:

  • Adds optional SDK transaction IDs to transaction navigation state and route query parameters.
  • Propagates real IDs from transaction lists, groups, and transaction creation flows.
  • Adds fetch-failure logging, ID fallback handling, redirect recovery, and comprehensive tests.
File Description
front-end/​src/​tests/​renderer/​stores/​storeNextTransactionV2.spec.ts Tests transaction ID propagation through navigation and route query parameters.
front-end/​src/​tests/​renderer/​pages/​Transactions/​components/​TransactionNodeTable.spec.ts Tests transaction-row navigation with real transaction IDs.
front-end/​src/​tests/​renderer/​pages/​Transactions/​components/​History.spec.ts Tests real ID propagation for local and organization history navigation.
front-end/​src/​tests/​renderer/​pages/​TransactionGroupDetails/​TransactionGroupRow.spec.ts Updates group-row navigation event expectations for real transaction IDs.
front-end/​src/​tests/​renderer/​pages/​TransactionGroupDetails/​TransactionGroupDetails.spec.ts Tests real transaction ID propagation through group details navigation.
front-end/​src/​tests/​renderer/​pages/​TransactionDetails/​TransactionDetails.spec.ts Tests fetch-failure messaging, structured logging, fallback IDs, and redirects.
front-end/​src/​tests/​renderer/​components/​Transaction/​Create/​BaseTransaction/​BaseTransaction.spec.ts Tests transaction ID propagation after creation and local storage.
front-end/​src/​renderer/​stores/​storeNextTransactionV2.ts Carries optional SDK transaction IDs through transaction navigation routes.
front-end/​src/​renderer/​pages/​Transactions/​components/​TransactionNodeTable.vue Passes real transaction IDs from transaction list rows into navigation.
front-end/​src/​renderer/​pages/​Transactions/​components/​History.vue Passes real transaction IDs from local and organization history entries.
front-end/​src/​renderer/​pages/​TransactionGroupDetails/​TransactionGroupRow.vue Emits the real transaction ID when opening a group transaction.
front-end/​src/​renderer/​pages/​TransactionGroupDetails/​TransactionGroupDetails.vue Preserves real transaction IDs during group-detail navigation and sibling traversal.
front-end/​src/​renderer/​pages/​TransactionDetails/​TransactionDetails.vue Reports fetch failures with meaningful IDs and structured context, then redirects after initial failure.
front-end/​src/​renderer/​components/​Transaction/​Create/​BaseTransaction/​BaseTransaction.vue Carries transaction IDs from transaction creation into detail navigation.

Review effort: Lite

const targetNodeId: TransactionNodeId = { transactionId: id };
const targetNodeId: TransactionNodeId = {
transactionId: id,
sdkTransactionId: transaction.value.transactionId?.toString(),
// an infinite loader. Toast manually since catching here stops it from reaching the global
// onErrorCaptured handler.
toastManager.error(getErrorMessage(error, 'An error occurred'));
await redirectToPreviousTransactionsTab(router);
Comment on lines +374 to +375
toastManager.error(getErrorMessage(error, 'An error occurred'));
await redirectToPreviousTransactionsTab(router);
jbair06 and others added 2 commits November 20, 2026 09:07
…id in the toast

Wraps the whole fetch in one handler that logs dbId and sdkTransactionId; the toast uses the real id or a generic contact-admin message. Also logs the initial-load redirect and signature key failures.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: John Bair <john.bair@swirldslabs.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: John Bair <john.bair@swirldslabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug A error that causes the feature to behave differently than what was expected based on design docs Frontend Frontend development work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transaction-fetch failure toast shows the local DB id instead of the real transaction id

2 participants